package com.zimin.mapper.config;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import org.n3r.idworker.Sid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zimin
 * @since 2021/10/14 2:26 下午
 */
@Component
public class MybatisPlusIdGenerator implements IdentifierGenerator {

    @Autowired
    private Sid sid;

    @Override
    public Number nextId(Object entity) {
        return null;
    }

    @Override
    public String nextUUID(Object entity) {
        return sid.nextShort();
    }
}
